package cn.zzmx.service;


import cn.zzmx.entity.Role;
import cn.zzmx.entity.UserRole;
import cn.zzmx.mapper.IRoleMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional(propagation = Propagation.REQUIRED,isolation = Isolation.REPEATABLE_READ,readOnly = false)
public class IRoleServiceImpl implements IRoleService{

    @Autowired
    private IRoleMapper iRoleMapper;


    @Override
    @Transactional(readOnly = true)
    public List<Role> queryUserNotRole(String userId) {

        List<Role> roles = iRoleMapper.queryUserNotRole(userId);


        return roles;
    }

    @Override
    public void addUserRole(UserRole userRole) {
        iRoleMapper.addUserRole(userRole);
    }
}
